<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="recommenRatings.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="recommenRatings.domain.Place"%>
<%@page import="recommenRatings.domain.Opinion"%>
<%@page import="recommenRatings.domain.OpinionManager"%><html>
<head>
<meta http-equiv="Refresh" content="5;url=FrontController?res=start.jsp">
<title>Inserte su opinion</title>
</head>
<body>
<%
	String name=request.getParameter("name");
	String address=request.getParameter("address");
	String phoneNumber=request.getParameter("phoneNumber");
	String fax=request.getParameter("fax");
	String web=request.getParameter("web");
	String type=request.getParameter("type");
	String subtype=request.getParameter("subtype");
	String state=request.getParameter("state");
	String city=request.getParameter("city");
	String price=request.getParameter("price");
	Double rate= new Double(request.getParameter("rate"));
	String text=request.getParameter("text");
	
	String username= (String)session.getAttribute("session.user");
	Place p=new Place(name,address,phoneNumber,city,state,fax,web,price,type,subtype);
	Opinion o=new Opinion(rate,text);
	
	OpinionManager om=new OpinionManager();
	om.addOpinion(o,username,p);	
%>
<p>Tu opinion se ha insertado correctamente</p>
<p>Redirigiendo a la pagina principal...</p>
</body>
</html>